Python: Add Eden AI chat client provider - #7308
Conversation
Eden AI is a gateway to many model providers behind one OpenAI compatible API and a single key. This adds an agent-framework-edenai package with an EdenAIChatClient, following the same pattern as the Foundry Local client (it subclasses the OpenAI chat completion client and points it at the Eden AI base URL). Models use the provider/model format, for example openai/gpt-4o-mini or anthropic/claude-sonnet-4-5, so the catalog is not hardcoded. - New package python/packages/edenai (client, settings, options, tests, README, AGENTS) - Namespace shim agent_framework.edenai in core, plus the workspace source entry - EDENAI_API_KEY, EDENAI_MODEL and optional EDENAI_BASE_URL settings - Provider sample under samples/02-agents/providers/edenai and a row in the providers overview - cspell dictionary entry Verified end to end against the live Eden AI API (openai and anthropic models). ruff, mypy and pyright are clean and the unit tests pass.
There was a problem hiding this comment.
Pull request overview
Adds a new Python provider package (agent-framework-edenai) that integrates Eden AI as an OpenAI-compatible gateway, along with a core agent_framework.edenai shim, sample usage, and unit tests consistent with existing provider packages.
Changes:
- Introduces
agent-framework-edenaipackage withEdenAIChatClient, settings resolution (EDENAI_*), middleware/telemetry/function-invocation composition, and typed options. - Wires the connector into the workspace and core namespace shim (
agent_framework.edenai) for optional installation. - Adds a provider sample and unit tests mirroring the Foundry Local pattern, plus docs/spellcheck updates.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/02-agents/providers/README.md | Adds Eden AI to the provider samples index. |
| python/samples/02-agents/providers/edenai/README.md | Documents setup/env vars and links the Eden AI sample script. |
| python/samples/02-agents/providers/edenai/edenai_chat_client.py | Runnable Eden AI client sample including a function tool. |
| python/pyproject.toml | Registers agent-framework-edenai as a workspace package dependency. |
| python/packages/edenai/tests/test_edenai_client.py | Adds settings/client initialization tests and signature shape assertions. |
| python/packages/edenai/tests/conftest.py | Adds test env fixtures for EDENAI_* variables. |
| python/packages/edenai/README.md | Adds package README and quickstart snippet. |
| python/packages/edenai/pyproject.toml | Defines the new package metadata, dependencies, and tooling config. |
| python/packages/edenai/LICENSE | Adds package license file. |
| python/packages/edenai/AGENTS.md | Adds package-level usage/config documentation for contributors. |
| python/packages/edenai/agent_framework_edenai/py.typed | Marks the package as typed for type checkers. |
| python/packages/edenai/agent_framework_edenai/_chat_client.py | Implements EdenAIChatClient, options/settings, and OpenAI-compatible client wiring. |
| python/packages/edenai/agent_framework_edenai/init.py | Exposes public API and package version. |
| python/packages/core/agent_framework/edenai/init.pyi | Adds typing-only re-exports for the core shim namespace. |
| python/packages/core/agent_framework/edenai/init.py | Adds lazy import shim for optional Eden AI connector. |
| python/.cspell.json | Adds edenai to the dictionary. |
| @@ -0,0 +1,19 @@ | |||
| # Get Started with Microsoft Agent Framework Eden AI | |||
|
|
|||
| Please install this package as the extra for `agent-framework`: | |||
| from agent_framework.edenai import EdenAIChatClient | ||
|
|
||
| # Reads EDENAI_API_KEY from the environment, or pass api_key=... | ||
| client = EdenAIChatClient(model="openai/gpt-4o-mini") | ||
| response = await client.get_response("Hello") |
| from agent_framework.edenai import EdenAIChatClient | ||
|
|
||
| client = EdenAIChatClient(model="openai/gpt-4o-mini") | ||
| response = await client.get_response("Hello") |
|
@microsoft-github-policy-service agree company="Eden AI" |
The README and AGENTS.md examples passed a raw string to get_response, which expects a list of Message objects and would fail at runtime. Also aligned the install line wording with the other provider packages.
|
@MVS-source thanks for the input here, but at this time we don't want to add more providers like this, since they tend to be quite limited in what they add over just putting the right URL and key into a OpenAIChatCompletionClient. Since we also don't use this service ourselves, maintaining this is also difficult, but do feel free to host and release this outside of our repo! and as a sidenote, you can supply your own Options as a dev, so exposing specific options is possible natively. |
Adds an
agent-framework-edenaipackage with anEdenAIChatClient.Eden AI is a gateway to many model providers behind one OpenAI compatible API and a single key, so one integration gives access to a broad model catalog. It is hosted in the EU and does not store prompts or outputs by default, which is a useful option for teams with data residency needs. Models use the
provider/modelformat (for exampleopenai/gpt-4o-minioranthropic/claude-sonnet-4-5), so the catalog is not hardcoded.What is included:
python/packages/edenaiwithEdenAIChatClient,EdenAIChatOptionsandEdenAISettings. It follows the Foundry Local pattern: it subclasses the OpenAI chat completion client and points it at the Eden AI base URL, since Eden AI is OpenAI compatible.agent_framework.edenainamespace shim in core, plus the workspace source entry so the package resolves like the other connectors.EDENAI_API_KEY,EDENAI_MODEL, and optionalEDENAI_BASE_URL(defaults tohttps://api.edenai.run/v3).samples/02-agents/providers/edenai, a row in the providers overview, and a cspell dictionary entry.Notes:
openaiSDK already used by the OpenAI package).ruff format,ruff check,mypyandpyrightare clean, and the unit tests pass.Happy to adjust naming, versioning or the docs wiring to match your conventions. I can also add an embedding client later if that is useful.